package hlhj.fhp.checkpoint.adp

import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import hlhj.fhp.checkpoint.atys.OrderAty
import hlhj.fhp.checkpoint.fgms.OrderListFgm

/**
 * Created by Never Fear   on 2018\11\12 0012.
Never More....
 */
class OrderPagerAdp(fm:FragmentManager,private val fgmLists:ArrayList<Fragment>):FragmentPagerFlushAdapter(fm) {
    override fun getItem(position: Int): Fragment {
        return fgmLists[position]
    }

    override fun getCount(): Int {
        return fgmLists.size
    }

    override fun getPageTitle(position: Int): CharSequence {
//        return super.getPageTitle(position)
        if (OrderAty.type==1){
            when(position){
                0->{
                    return "全部"
                }
                1->{
                    return "待报价"
                }
                2->{
                    return "无法代办"

                }
                3->{
                    return "待付款"

                }
                4->{
                    return "处理中"

                }
                5->{
                    return "已完成"
                }
                else->{
                    return ""
                }
            }
        }else if (OrderAty.type==2){
            when(position){
                0->{
                    return "全部"
                }
                1->{
                    return "待支付"
                }
                2->{
                    return "已撤销"

                }
                3->{
                    return "处理中"

                }
                4->{
                    return "已完成"

                }
                else->{
                    return ""
                }
            }
        }else{
            return ""
        }


    }
}